import 'package:flutter/material.dart';
import 'package:interview/components/app/app_ripple_button.dart';
import 'package:interview/theme/app_colors.dart';


/// 可复用的菜单项组件
class PageMenuItem extends StatelessWidget {
  final String text;
  final IconData icon;
  final VoidCallback onTap;
  final AppColors theme; // 自定义的主题对象

  const PageMenuItem({
    Key? key,
    required this.icon,
    required this.text,
    required this.onTap,
    required this.theme,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return AppRippleButton(
      backgroundColor: theme.subjectPure!,
      splashColor: theme.contrastMix3!.withOpacity(0.2),
      highlightColor: theme.subjectMix1!.withOpacity(0.1),
      padding: const EdgeInsets.symmetric(horizontal: 12 , vertical: 12),
      onTap: onTap,
      child: Center(
        child: Row(
          children: [
            Icon(icon  ,size: 14, color:theme.contrastMix3 ,),
            SizedBox(width: 8,),
            Text(
              text,
              style: TextStyle(
                fontSize: 14,
                fontWeight: FontWeight.w500,
                color: theme.contrastMix3,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
